﻿using BCDto.TMS.WorkingCompany;
using BCService.TMS.WorkingCompany;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Net;

namespace BCTMSRESTful.Controllers.DriverApp.WorkingCompany
{
    /// <summary>
    /// 劳务公司信息
    /// </summary>
    [ApiExplorerSettings(GroupName = "DriverApp")]
    [Route("api/v1/DriverApp/[controller]")]
    public class WorkingCompanyController : DriverAppBaseController
    {
        #region 私有变量
        private IWorkingCompanyService workingCompanyService;
        #endregion


        #region 构造函数
        /// <summary>
        /// 构造函数
        /// </summary> 
        public WorkingCompanyController(IWorkingCompanyService workingCompanyService)
        {
            this.workingCompanyService = workingCompanyService;
        }
        #endregion

        #region 获取劳务公司列表 
        /// <summary>
        /// 获取劳务公司列表
        /// </summary> 
        /// <param name="countyCode">区县编码</param> 
        /// <returns></returns>
        [HttpGet("{county_code}")]
        [ProducesResponseType(typeof(IEnumerable<WorkingCompanyDto>), 200)]
        public IActionResult Get([FromRoute(Name = "county_code")] string countyCode)
        { 
            return StatusCode((int)HttpStatusCode.OK, workingCompanyService.GetListByCountyCode(countyCode));
        }
        #endregion
    }
}
